{extend name="base" /} {block name="body"}
<div class="layui-body">
	<div class="navbar">
		<a><cite>会员管理</cite></a>&nbsp;<span class="layui-box">&gt;</span>
		<a href=""><cite>企业会员列表</cite></a>
	</div>
	<!--tab标签-->
	<div class="layui-tab layui-tab-brief">
		<ul class="layui-tab-title">
			<li class="layui-this">企业会员列表</li>
			<!--<li class="">
				<a href="{:url('member/add')}">添加会员</a>
			</li>-->
		</ul>
		<div class="layui-tab-content">
			<form class="layui-form layui-form-pane" action="{:url('member/index')}" method="get">
				<div class="layui-inline">
					<label class="layui-form-label">关键词</label>
					<div class="layui-input-inline">
						<input type="text" name="keyword" value="{$keyword}" placeholder="请输入会员昵称或者姓名或者手机号" class="layui-input">
					</div>
				</div>
				
				<div class="layui-inline">
					<label class="layui-form-label">排序</label>
					<div class="layui-input-inline">
						<select name="param">
							<option value="add_time" {if $param=='add_time' }selected{/if}>注册时间</option>
							<option value="money" {if $param=='money' }selected{/if}>余额</option>
						</select>
					</div>
				</div>
				<div class="layui-inline">
					<select name="sort">
						<option value="asc" {if $sort=='asc' }selected{/if}>从低到高</option>
						<option value="desc" {if $sort=='desc' }selected{/if}>从高到底</option>
					</select>
				</div>
				<div class="layui-inline">
					<button class="layui-btn">搜索</button>
				</div>
			</form>
			<hr>
			累积会员：{$count?$count : 0}
			<table class="layui-table">
				<thead>
					<tr>
						<th>ID</th>
						<th>头像</th>
						<th>账号(手机号)</th>
						<th>昵称</th>
						<th>性别</th>
						<th>openid</th>
						<th>余额</th>
						<th>状态</th>
						<th>推荐人ID</th>
						<th>推荐人昵称</th>
						<th>注册时间</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					{foreach name="member_list" item="vo"}
					<tr>
						<td>{$vo.id}</td>
							<td><img src="{$vo.logo}" style="width: 40px;height: 40px;border-radius: 50%;"/></td>
						<td>{$vo.mobile}</td>
						<td>{$vo.nick_name}</td>
						<td>
							{if $vo.sex == 1}
							男
							{elseif $vo.sex == 2}
							女
							{else}
							保密
							{/if}
						</td>
						<td>{$vo.open_id}</td>
						<td>{$vo.money}</td>
						<td>{if $vo.status==1}正常{else}已冻结{/if}</td>
						<td>{$vo.pid1}</td>
						<td>{$vo.tjname}</td>
						<td>{$vo.btime}</td>
						<td>
							
							<a href="{:url('member/edit',['id'=>$vo['id']])}" class="layui-btn layui-btn-normal layui-btn-small">编辑</a>
							{if $vo.status==1}
							<a ref="delete_item?id={$vo.id}&status=2" class="layui-btn layui-btn-danger layui-btn-small confirm">冻结</a>
							{/if}
							{if $vo.status==2}
							<a ref="delete_item?id={$vo.id}&status=1" class="layui-btn layui-btn-danger layui-btn-small confirm">启用</a>
							{/if}
							{if $vo.is_city!=1}
							<a ref="ct1edit?id={$vo.id}" class="layui-btn layui-btn-normal layui-btn-small confirm">升级运营中心</a>
							{/if}
							{if $vo.is_pt!=1}
							<a ref="pt1edit?id={$vo.id}" class="layui-btn layui-btn-normal layui-btn-small confirm">升级合伙人</a>
							{/if}
						</td>
					</tr>
					{/foreach}
				</tbody>
			</table>
			<!--分页-->
			{$member_list->render()}
		</div>
	</div>
</div>
<script>
	// 定义全局JS变量
	var GV = {
		current_controller: "{$controller}/qy_members"
	};
</script>
{/block}